<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>

<body>
    <p>hello</p>
    <script src="https://cdn.bootcss.com/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js"></script>
    </script>
    <!-- <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> -->
    <script type="text/javascript">
    var host = "ws://39.108.123.152:8006"
    if (host != "") {
        // const h = vue.$createElement;
        var ws = new ReconnectingWebSocket(host);
        ws.onopen = function() {
            // var json = {
            //     code: 101,
            //     token: $.cookie('token')
            // }
            // ws.send(JSON.stringify(json))
            // console.log('connectd') 
        }
        ws.onclose = function() {}
        ws.onerror = function() {};
        ws.onmessage = function(data) {
            console.log(data.data)
            // var json = jQuery.parseJSON(data.data);
            // if (json.code == '102') {
            //     var noti = vue.$notify({
            //         title: json.title,
            //         message: h('i', { style: 'color: teal' }, json.content),
            //         onClick: function() {
            //             noti.close()
            //         }
            //     });
            // }
        }
    }
    </script>
</body>

</html>